/*
 * Copyright 2009 BioTeam Inc
 * 
 * Licensed under License GNU LESSER GENERAL PUBLIC LICENSE version 3.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package net.bioteam.appweb.model;

import static javax.persistence.GenerationType.TABLE;
import static javax.persistence.TemporalType.TIMESTAMP;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;

@Entity(name="SavedRun")
@Table(name="SAVEDRUN")
@NamedQueries({@NamedQuery(name="savedruns", query = "select sr from SavedRun  sr where sr.username = :username order by sr.name, sr.savedTime"),@NamedQuery(name="deleterun", query = "delete SavedRun sr where sr.id=:id")})
public class ProgramTemplate implements Serializable {
	
	@Id
	@Column(updatable=false)
	@GeneratedValue(strategy=TABLE, generator = "savedrun_id_generator")
	@TableGenerator(name="savedrun_id_generator", table = "SEQUENCES", pkColumnName = "NAME", valueColumnName = "SEQVALUE", pkColumnValue = "savedrun")
	protected long id;
	@Column(name="PROGRAMNAME", updatable = false)
	protected String programName;
	
	@Column(updatable=false, name = "USERID")
	protected String username;
	
	protected String name;
	protected String description;
	@Column(updatable=false)
	@Temporal(TIMESTAMP)
	protected Date savedTime;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public ProgramTemplate()
	{
	}
	public String getProgramName() {
		return programName;
	}

	public void setProgramName(String programName) {
		this.programName = programName;
	}

	public Date getSavedTime() {
		return savedTime;
	}

	public void setSavedTime(Date savedTime) {
		this.savedTime = savedTime;
	}

	
	public long getId() {
		return id;
	}
	
	public void setId(long i) {
		id=i;
	}


	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
}
